import http from '@/utils/http'
//添加商品到购物车
export const addCartAPI = ({skuId,count})=>{
    return http({
        url:'/member/cart',
        method:'POST',
        data:{
            skuId,
            count
        }
    })
}   
//获取用户的购物车列表
export const getCartListAPI = ()=>{
    return http({
        url:'/member/cart',
        method:'GET'
    })
}
//删除购物车内指定商品  参数：[ids]
export const delCartAPI = (ids:[])=>{
    return http({
        url:'/member/cart',
        method:'delete',
        data:{
            ids
        }
    })
}
//合并本地购物车
//参数  包含skuID selected count 三个字段的数组
export const mergeCart = (data:[])=>{
    return http({
        url:'/member/cart/merge',
        method:'post',
        data
    })
}